package com.evan.design.principle.openclose;

/**
 * @author :liujiapeng01
 * @date :2019-03-20 19:16
 **/
public class Test {
    public static void main(String[] args) {
        ICourse course = new JavaCourse(96, "javaCourse", 100d);
        System.out.println("课程" + course.getId() + "课程名称:" + course.getName() + "价格:" + course.getPrice());


        ICourse course1 = new JavaDiscountCourse(96, "javaCourse", 100d);
        JavaDiscountCourse discountCourse = (JavaDiscountCourse) course1;
        System.out.println("课程" + discountCourse.getId() + " 课程名称 :" + discountCourse.getName() + " 价格:" + discountCourse.getPrice() + " 课程原价:" + discountCourse.getDisCountPrice());


    }

}
